VK: Split 05-recruits into four Cardinal Virtue tutorials = - #16
Open
vkurapat wants to merge 6 commits into
Open
VK: Split 05-recruits into four Cardinal Virtue tutorials =#16vkurapat wants to merge 6 commits into
vkurapat wants to merge 6 commits into
Conversation
…rate DGM linear content Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAfJeVM4b87jrAjQeQUkZt
…th predictions(datagrid()) plot_predictions() on a parsnip logistic_reg() fit with a continuous `condition` exhausts memory under marginaleffects 0.32.0, failing the tutorial render. Exercises 10-11 now sweep MonthlyIncome via an explicit datagrid() passed to predictions() -- equivalent output, and datagrid() is already introduced in Exercise 6. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAfJeVM4b87jrAjQeQUkZt
…plot columns resolve datagrid() with a function-valued grid variable did not carry MonthlyIncome into the predictions() output on the CI marginaleffects, breaking geom_ribbon() with "object 'MonthlyIncome' not found". Build the grid as an explicit tibble()/expand_grid() instead -- predictions(newdata = <df>) always returns the newdata columns, so the plot code resolves on every marginaleffects version. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XAfJeVM4b87jrAjQeQUkZt
…tic predictions-12 plot_predictions(mod_logistic, by = "OverTime", type = "prob", draw = FALSE) crashes under marginaleffects 0.32.0. Exercise 12 now pipes avg_predictions(by = "OverTime") into ggplot(). With Exercises 10-11 already switched to predictions(), plot_predictions() is no longer used in the section, so the covered-functions lists and recap prose are updated to match.
…ctions call avg_predictions(mod_logistic, by = "OverTime", type = "prob") does not echo the OverTime column on the CI marginaleffects, breaking aes(x = OverTime) with "object 'OverTime' not found". Run avg_predictions() on extract_fit_engine() (the underlying glm) instead: response scale is already P(leaving), no type or group filtering, and by= reliably returns the OverTime column.
…ine() predictions()/avg_predictions() on the parsnip logistic_reg() wrapper do not reliably echo the grid or by= variable as a named column under the CI marginaleffects, so ggplot(aes(x = MonthlyIncome / OverTime)) fails with "object not found". Exercises 5, 10, 11, and 12 now call these functions on extract_fit_engine(mod_logistic) (the underlying glm, type = "response"), which returns those columns and the probability scale directly -- no type = "prob" or group filter. Printed chunks (1-4, 6-9) keep the tidymodels wrapper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
and incorporate DGM linear content.